package com.yunxi.model.vehicle;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 生产车型型谱
 * </p>
 *
 * @author 
 * @since 2019-05-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("base_vehicle_spectrum")
@ApiModel(value="BaseVehicleSpectrum对象", description="生产车型型谱")
public class VehicleSpectrum implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键ID")
    @TableId(value = "PRODUCT_ID", type = IdType.UUID)
    private String productId;

    @ApiModelProperty(value = "品牌代码")
    @TableField("PRODUCT_TYPE_CODE")
    private String productTypeCode;

    @ApiModelProperty(value = "品牌名称")
    @TableField("PRODUCT_TYPE_NAME")
    private String productTypeName;

    @ApiModelProperty(value = "产品代码")
    @TableField("PARENT_NODE_CODE")
    private String parentNodeCode;

    @ApiModelProperty(value = "产品名称")
    @TableField("PARENT_NODE_NAME")
    private String parentNodeName;

    @ApiModelProperty(value = "车系ID")
    @TableField("NODE_CODE")
    private String nodeCode;

    @ApiModelProperty(value = "车型代码")
    @TableField("NODE_NAME")
    private String nodeName;

    @ApiModelProperty(value = "配置代码")
    @TableField("NODE_TYPE")
    private String nodeType;

    @ApiModelProperty(value = "创建时间")
    @TableField(value = "CREATE_TIME",fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty(value = "创建人")
    @TableField("CREATE_BY")
    private String createBy;

    @ApiModelProperty(value = "修改时间")
    @TableField(value = "UPDATE_TIME",fill = FieldFill.UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "修改人")
    @TableField("UPDATE_BY")
    private String updateBy;

    @ApiModelProperty(value = "状态1启用0禁用")
    @TableField("STATUS")
    private Integer status;

    @ApiModelProperty(value = "是否删除")
    @TableField("IS_DEL")
    private Integer isDel;

    @ApiModelProperty(value = "备注")
    @TableField("MEMO")
    private String memo;

    @ApiModelProperty(value = "版本")
    @TableField("VERSION")
    private Integer version;

    @ApiModelProperty(value = "是否发送")
    @TableField("IS_SEND")
    private Integer isSend;

    @ApiModelProperty(value = "业务级别")
    @TableField("BUS_LEVEL")
    private String busLevel;

    @ApiModelProperty(value = "ToB业务场景")
    @TableField("TO_B")
    private Integer toB;

    @ApiModelProperty(value = "ToC业务场景")
    @TableField("TO_C")
    private Integer toC;

    private transient Integer hasChild;

    private transient String firstFactory;
    private transient Integer isBom;

    public String getAliasName() {
        if(StringUtils.isEmpty(aliasName)){
            this.aliasName = this.nodeName;
        }
        return aliasName;
    }

    private transient Integer isConfig;
    private String aliasName;
    private transient String fullName;
}
